<?php

include ('../session.php');
include ('../db.php');
include ('config.php');

$output = '';

$output .= "
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<html>
  <head>
    <title>Panic Points - List Items</title>
    <link href=\"../general.css\" rel=\"stylesheet\" type=\"text/css\">
  </head>
  <body>";

include ('navigation.php');

$query = "select item_id, item_name, item_value
          from " . DKP_ITEMS . "
          order by item_name asc";
$result = mysql_query ($query);

$output .= "
    <span class=\"listtitle\">items</span>
    <table class=\"list\" cellspacing=\"0\" cellpadding=\"0\">
      <tr class=\"listheader\">
        <td>item</td>
        <td>value</td>
      </tr>";

$i = 0;
while ($row = mysql_fetch_array ($result))
{
  $i++;

  $output .= "
      <tr class=\"" . ($i & 1 ? "listodd" : "listeven") . "\">
        <td><a href=\"viewitem.php?itemid=" . $row['item_id'] . "\">" . $row['item_name'] . "</a></td>
        <td>" . $row['item_value'] . "</td>
      </tr>";
}

$output .= "
    </table>";

$output .= "
    <a href=\"additem.php\">add item</a>";

    
$output .= "
  </body>
</html>";

echo $output;

?>
